# Maintainer: Morten Linderud <foxboron@archlinux.org>

pkgname=python-sphinx-autorun
_pkgname=sphinx-autorun
pkgver=1.1.1
pkgrel=6
pkgdesc="Sphinx extension to execute the code output it into a document."
arch=('any')
url="https://github.com/WhyNotHugo/sphinx-autorun"
license=('BSD')
depends=('python')
makedepends=('git' 'python-setuptools-scm')
_commit=7a4c2c99a29e5e9e9b0838fac0419d00c5675f8b
source=("git+https://github.com/WhyNotHugo/sphinx-autorun#commit=${_commit}")
sha512sums=('SKIP')

pkgver() {
  cd "${_pkgname}"
  git describe --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "${_pkgname}"
    python setup.py build
}

package() {
    cd "${_pkgname}"
    python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
    install -Dm0644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENCE"
}
